package main

import "fmt"

// for 循环共用地址
func main() {
	fmt.Println("运行成功")
	type User struct {
		Name string
	}

	um := make(map[string]*User, 2)

	usersList := []User{
		{Name: "Tom"},
		{Name: "Jerry"},
	}
	fmt.Println(usersList)
	fmt.Printf("%+v \n", usersList)
	for _, u := range usersList {
		fmt.Println("u", u)
		fmt.Printf("%p   %v \n", &u, u)
		um[u.Name] = &u
	}
	fmt.Printf("%v \n", um)
	fmt.Printf("%+v \n", *um["Jerry"])
	fmt.Printf("%+v \n", *um["Tom"])
}
